<%@page import="java.util.ArrayList"%>
<%@page import="bean.MemberVo"%>
<%@page import="bean.MemberDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel ='stylesheet' href ="./Js/member/member.css"/>
<script src="./Js/member/member.js"></script>
</head>
<body>
	<jsp:useBean id="vo" class="bean.MemberVo" scope="page"/>
	<jsp:setProperty property="*" name="vo"/>
	<%
		request.setCharacterEncoding("utf-8");
	%>
	
	
	<%
	MemberDTO dto =new MemberDTO();
	dto.setVo(vo);
	ArrayList<MemberVo> al = dto.select();
	%>

<h1>List</h1>
<div  id ='member_list_find' >
	<form name = 'member_list_frm' method ='post' action ='index.jsp?inc=./Js/member/list.jsp'>
		<input type='text' name='find' value='<%=vo.getFind()%>'/> 		
		<input type='submit' value='검색' />
	</form>
</div>

	<div id='member_list_title'>
		<div class='member_list_mid'>아이디</div>
		<div class='member_list_irum'>이름</div>
		<div class='member_list_phone'>전화번호</div>
	</div>
	
	<%for(int a=0; a<al.size();a++){
			MemberVo v=al.get(a);%><br/>
			
	<div class='member_list_items'>
	<div class='member_list_mid'>	
		<a href='#' onclick="goView(<%=dto.getNowPage()%>,'<%=v.getMid()%>')"><%=v.getMid()%></a>
	</div>
		<div class='member_list_mid'><%=v.getMid() %></div>
		<div class='member_list_irum'><%=v.getIrum() %></div>
		<div class='member_list_phone'><%=v.getPhone() %></div>
	</div>
		<%}%>
	

	<div id='list_page'>
		<%if(dto.getStartPage() !=1){%>
		<a href='#' onclick='goPage(1)'>맨처음</a>
		<a href='#' onclick='goPage(<%=dto.getStartPage()-1%>)'>이전</a>
		<%}%>
		
		<% 
			int i=0;
		for(i= dto.getStartPage(); i<=dto.getEndPage();i++){%>
			<a href='#' onclick='goPage(<%=i%>)'><%=i%></a>
		<%}%>
			
		<% if(dto.getTotPage() != dto.getEndPage()){%>
			<a href='#' onclick='goPage(<%=i%>)'>다음</a>
		<%}%>

		<a href='#' onclick='goPage(<%=dto.getTotPage()%>)'>맨끝</a>
	</div>
<input type = 'button' value ='회원  작성' id='btnInput'/>

<p/>
	

	<form name='hidfrm' method='post'>
		<input type='hidden' name='nowPage' value="<%=vo.getNowPage()%>"> 
		<input type='hidden' name='find'  value="<%=vo.getNowPage()%>"> 
		<input type='hidden' name='mid'  value="<%=vo.getNowPage()%>">
	</form>
	<script>listInit();</script>












</form>
<script>listInit();</script>

</body>
</html>